package cn.zniot.so.apiprovide.business;

import java.util.Map;

import cn.zniot.so.database.DBManager;

public class ForgetSecretHandler extends AbstractHandler {
	private String username;// box的id号
	private String password;
	private String resetpassword;

	/**
	 * 方法名：handle(Map<String, String> params) 
	 * 功　能：根据用户名和密码查询数据库返回id号的xml文件
	 * 参　数：Map<String, String> params - &参数键值对 
	 * 返回值：String - &xml文件包含头文件和实体内容
	 */
	public String handle(Map<String, String> params) {
		password= loadDbParserParmeter(params);
		String xmlStr = pageMaker(password);
		return xmlStr;
	}

	/**
	 * 方法名：loadDbParserParmeter(Map<String, String> params) 
	 * 功　能：&功能说明
	 * 参　数：Map<String, String> params -&输入参数键值对 
	 * 返回值：String - &返回车机id号
	 */
	public  String loadDbParserParmeter(Map<String, String> params) {
		username = params.get("username");
		password = params.get("password");
		resetpassword = params.get("resetpassword");
		password = DBManager.getInstance().findPassword(username,password,resetpassword);
		return password;
	}
}
